home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Info-Mac 4
/
Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso
/
Communications
/
General
/
Avtek ARA Scripts V1.1
/
Avtek CD940
< prev
next >
Wrap
Text File
|
1994-04-06
|
3KB
|
203 lines
!"Avtek MegaPlus V22bis CD940 - 6th April 1994 - NJS - v1.1
!
!
@ORIGINATE
@ANSWER
!
@LABEL 1
serreset 19200, 0, 8, 1
!
! first sync up the modem
!
matchclr
matchstr 1 3 "A"
settries 0
@LABEL 2
write "A"
matchread 10
inctries
iftries 4 3
jump 2
@LABEL 3
matchclr
settries 0
matchstr 1 4 "OK\13\10"
write "T\13"
matchread 30
!
! Now, recall the modems factory configuration
!
@LABEL 4
matchstr 1 5 "OK\13\10"
write "AT&F\13"
matchread 30
inctries
iftries 2 59
! Modem is not responding, reset
DTRClear
pause 5
DTRSet
jump 4
!
! Next, Set up the configuration:
! Echo off, turn off auto answer
! Ignore DTR
!
@LABEL 5
matchstr 1 6 "OK\13\10"
write "ATE0&D0S0=0\13"
matchread 30
jump 59
!
! Connect in Constant speed mode, no MNP, Hardware flow control
!
@LABEL 6
matchstr 1 7 "OK\13\10"
write "AT\\N0&D0&K3%C0X1&C1\13"
matchread 30
jump 59
!
! Set up the speaker: If speaker flag is "1", jump to 8; else turn off speaker
!
@LABEL 7
ifstr 2 8 "1"
matchstr 1 8 "OK\13\10"
write "ATM0\13"
matchread 30
jump 59
!
! The modem is ready. So enable answering, or originate a call
!
@LABEL 8
ifANSWER 30
! Dial with V32bis enabled
note "Dialing ^1" 3
write "ATS0=0F0DT^1\13"
!
@LABEL 9
matchstr 1 11 "CONNECT 1200\13\10"
matchstr 2 12 "CONNECT 2400\13\10"
matchstr 3 50 "NO CARRIER\13\10"
matchstr 4 50 "ERROR\13\10"
matchstr 5 52 "NO DIALTONE\13\10"
matchstr 6 53 "BUSY\13\10"
matchstr 7 54 "NO ANSWER\13\10"
matchread 700
jump 59
!
@LABEL 11
note "Modem connection established at 1200 bps." 2
CommunicatingAt 1200
jump 20
!
@LABEL 12
note "Modem connection established at 2400 bps." 2
CommunicatingAt 2400
jump 20
!
@LABEL 20
HSReset 0 1 0 0 0 1
ifANSWER 21
pause 30
!
@LABEL 21
exit 0
!
!
@LABEL 30
write "ATS0=2F0\13"
matchstr 1 31 "OK\13\10"
matchread 30
jump 59
!
@LABEL 31
matchstr 1 32 "RING\13\10"
matchstr 2 11 "CONNECT 1200\13\10"
matchstr 3 12 "CONNECT 2400\13\10"
matchstr 4 50 "NO CARRIER\13\10"
matchstr 5 50 "ERROR\13\10"
matchstr 6 52 "NO DIALTONE\13\10"
matchstr 7 53 "BUSY\13\10"
matchstr 8 54 "NO ANSWER\13\10"
matchread 700
jump 31
!
@LABEL 32
userhook 1
note "Answering phone…" 2
jump 31
!
! 50: error messages
!
@LABEL 50
exit -6021
!
@LABEL 52
exit -6020
!
@LABEL 53
exit -6022
!
@LABEL 54
exit -6023
!
@LABEL 59
exit -6019
!
! Hang up the modem
!
@HANGUP
@LABEL 60
settries 0
@LABEL 61
matchclr
matchstr 1 63 "OK\13\10"
matchstr 2 63 "NO CARRIER\13\10"
matchstr 3 63 "ERROR\13\10"
write "ATH\13"
matchread 30
inctries
iftries 3 63
! no response, try escape sequence
matchclr
matchstr 1 62 "OK\13\10"
write "+++"
matchread 20
!
! No response from modem, toggle DTR
!
DTRClear
pause 5
DTRSet
jump 61
!
@LABEL 62
pause 5
write "ATH0\13"
matchstr 1 63 "OK\13\10"
matchstr 2 63 "NO CARRIER\13\10"
matchstr 3 63 "ERROR\13\10"
matchread 70
jump 61
!
! Recall factory settings
!
@LABEL 63
pause 5
matchclr
matchstr 1 64 "OK\13\10"
write "AT&F\13"
matchread 30
!
! Turn off auto answer
!
@LABEL 64
write "ATS0=0\13"
matchstr 1 65 "OK\13\10"
matchread 30
!
!
@LABEL 65
exit 0